 <?php
   session_start();
   include("./connexion.php");
   
   //récupération de toutes les variables POST 
   $firstname=$_POST['firstname'];
   $lastname=$_POST['lastname'];
   $email=$_POST['email'];
   
	$birth = 	$_POST['birth'];

   $address_livraison = strtr(  $_POST['address_livraison'] ,  ' '  ,  '_'  );// remplace le caractère espace par le caractère underscore 
   $cp_livraison = $_POST['cp_livraison']; 
   $ville_livraison = $_POST['ville_livraison'];  
   $country_livraison = $_POST['country_livraison'];
   
   $address_facture = strtr(  $_POST['address_facture'] ,  ' '  ,  '_'  );
   $cp_facture = $_POST['cp_facture'];
   $ville_facture = $_POST['ville_facture'];
   $country_facture = $_POST['country_facture'];
   
   $address_cabinet = strtr(  $_POST['address_cabinet'] ,  ' '  ,  '_'  );
   $cp_cabinet = $_POST['cp_cabinet'];
   $ville_cabinet = $_POST['ville_cabinet'];  
   $country_cabinet = $_POST['country_cabinet'];
   
   $phone_fixe = $_POST['phone_fixe'];
   $phone = $_POST['phone'];
   
   $password=$_POST['password'];

	//insertion dans la BDD 
	$sql="INSERT INTO client VALUES('','$firstname','$lastname','$birth','$email','$address_livraison','$cp_livraison', '$ville_livraison',
	'$country_livraison','$address_facture','$cp_facture','$ville_facture','$country_facture','$address_cabinet','$cp_cabinet','$country_cabinet','$phone_fixe','$phone','$password')";
	$result = mysql_query($sql,$req)  or exit('$sql failed: '.mysql_error()); 
	header("Location: OKinscription.php");
	exit;
  
 ?>